<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="s" uri="/struts-tags"%>
<%@taglib prefix="pu" uri="/WEB-INF/tld/pageutil.tld" %>
<%@taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt-rt"%>
<%@taglib prefix="mu" uri="/WEB-INF/tld/mallutil.tld"%>
${pu:reqSet('order', pu:get('com.yaodian100.ec.order.entity.Orders', param.orderId)) }
<c-rt:if test="${order.orderSt!='81'}">
<script>
$(function(){
	$('#submit_button').click(function(){
		
		hasError=false;
		isChecked=false;
		checkedValue='';
		for(i=0;i<8;i++){
			if(document.cancelOrderForm.reason[i].checked){
				isChecked=true;
				checkedValue=document.cancelOrderForm.reason[i].value;
			}
		}
		if(!isChecked){
			hasError=true;
			alert('请选择取消订单原因');
		}
		if(checkedValue=='其它'){
			if(document.cancelOrderForm.description.value==''){
				hasError=true;
				alert('请描述原因');
			}
		}
		if(!hasError){
			$('#submit_button').hide();
			$('#hiddenWord').show();
		doAR('<c-rt:url value="/member/serviceOrder/cancelOrder.do"/>', 'cancelDialog', 'cancelOrderForm');
		}
	});
	
});
</script>
<p><strong>请告诉我们您想取消订单的原因，做为我们改进服务的重要参考：</strong></p> 
<c-rt:if test="${order.orderId ne order.joinOrders}">该单合并结帐, 订单 ${order.joinOrders} 将一并取消</c-rt:if>
    <form name="cancelOrderForm">    
    	<ul>
        	<li class="w-1of1"><label><input type="radio" value="想改商品属性（如颜色、尺寸等）" name="reason"> 想改商品属性（如颜色、尺寸等）</label></li>
            <li class="w-1of1"><label><input type="radio" value="想加买其他商品" name="reason"> 想加买其他商品</label></li>
            <li class="w-1of1"><label><input type="radio" value="买错了" name="reason"> 买错了</label></li>
            <li class="w-1of1"><label><input type="radio" value="等太久" name="reason"> 等太久</label></li>
            <li class="w-1of1"><label><input type="radio" value="结帐金额与活动不符" name="reason"> 结帐金额与活动不符</label></li>
            <li class="w-1of1"><label><input type="radio" value="商品比其他家贵" name="reason"> 商品比其他家贵</label></li>
            <li class="w-1of1"><label><input type="radio" value="支付不成功" name="reason"> 支付不成功</label></li>
            <li class="w-1of1"><label><input type="radio" value="其它" name="reason"> 其它</label> <input type="text" size="15" id="description" name="description"></li>
        </ul>
         <input type="hidden" name="token" value="${pu:getToken() }"/>
    	<input type="hidden" name="orderId" id="orderId" value="${param.orderId }"/>    	 
  </form> 
  <c-rt:if test="${mu:memberId()==order.memberId}">
  <p class="c-f"  align="center"><a href="javascript:;" id="submit_button" class="btn-mid" onFocus="blur()">确定取消</a>
  </c-rt:if>
  <br/>
  <span id="hiddenWord" style="display:none">订单取消处理中，请等待系统作业时间</span>
  </p> 
  </c-rt:if>
  <c-rt:if test="${order.orderSt=='81'}">
  <p>您已取消此笔订单!<br />您所取消的订单可能因為系统尚未更新状态，请耐心等待系统处理完成。</p> 
   <p class="c-f"  align="center"><a href="javascript:closeDialog();"class="btn-mid" onFocus="blur()">确定</a></p> 
  </c-rt:if>
  
